<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="/taglibs.jsp"%>
<s:actionerror cssClass="errmsg"/>
<s:actionmessage cssClass="errmsg"/>

      <s:form method="post" action="view.do">
		<table class="tb-batchdata">
          <tr>
          	<th width="30%">排程编号</th><td width="70%">${event.oid}</td>
          </tr>
          <tr>
          	<th>执行项目</th><td>${memuType.options[event.batchName].name}</td>
          </tr>
          <tr>
          	<th>建立人</th><td>${event.createUser}</td>
          </tr>
          <tr>
          	<th>批次建立时间</th><td><fmt:formatDate type="date" dateStyle="default" timeStyle="default" value="${event.createDate}" /> <fmt:formatDate pattern="HH:mm:ss" value="${event.createDate}" /></td>
          </tr>
          <tr>
          	<th>批次修改时间</th><td><fmt:formatDate type="date" dateStyle="default" timeStyle="default" value="${event.modifyDate}" /> <fmt:formatDate pattern="HH:mm:ss" value="${event.modifyDate}" /></td>
          </tr>
          <tr>
          	<th>开始排程时间</th><td><c:if test="${!empty event.startDate}">
          	<fmt:formatDate type="date" dateStyle="default" timeStyle="default" value="${event.startDate}" /> <fmt:formatDate pattern="HH:mm:ss" value="${event.startDate}" />
          	</c:if></td>
          </tr>
          <tr>
          	<th>开始执行时间</th><td><c:if test="${!empty event.runDate}">
          	<fmt:formatDate type="date" dateStyle="default" timeStyle="default" value="${event.runDate}" /> <fmt:formatDate pattern="HH:mm:ss" value="${event.runDate}" />
          	</c:if></td>
          </tr>
          <tr>
          	<th>结束执行时间</th><td><c:if test="${!empty event.endDate}">
          	<fmt:formatDate type="date" dateStyle="default" timeStyle="default" value="${event.endDate}" /> <fmt:formatDate pattern="HH:mm:ss" value="${event.endDate}" />
          	</c:if></td>
          </tr>
          <tr>
          	<th>排程状态</th><td>${event.status.desc}</td>
          </tr>
          <tr>
          	<th>修改资料笔数</th><td>${event.recordSize}</td>
          </tr>
          <tr>
          	<th>失败笔数</th><td>${event.failSize}</td>
          </tr><c:if test="${!empty  failDataKey}">
          <tr>
            <th>失败商品编号</th><td>${failDataKey}</td>
          </tr></c:if>
        </table>
        <br />
        <input type="button" value="回批次排程表" name="submit1" class="nstep" onclick="this.form.action='/ecadmin/batch/common/list.do';this.form.submit();">
        <c:if test="${actorId eq event.createUser && (event.status.code eq 'INIT' || event.status.code eq 'FINISH')}">
		<c:if test="${event.editable}">
		<input type="button" value="修改此批次" name="submit1" class="nstep" onclick="document.location='/ecadmin/batch/${event.batchName}/edit.do?paramBatchEventId=${event.oid}';"></c:if>
		<c:if test="${event.cancelable}">
		<input type="button" value="取消此批次" name="submit1" class="nstep" onclick="document.location='/ecadmin/batch/common/cancel.do?batchEventId=${event.oid}';"></c:if>
		</c:if>
     
      <h3 class="tword">以下为此批次所套用的资料详情，共${event.recordSize}笔：</h3>
	  <table width="100%" class="tb-1">
        <thead>
          <tr>
          <th>商品编号/商品名称</th>
 			<th>活动商品编号/活动商品名称</th>
          <th>简称</th>
          <th>活动开始时间</th>
          <th>活动结束时间</th>
          <th>活动售价</th>
          <th>活动状态</th>

          <th>失败原因</th>
        </tr>
        </thead>
        <tbody>
		<s:iterator value="detailMap" var="map" status="rows_index">
          <tr class="${rows_index.count % 2 == 0 ? 'bg-yl' : ''}">
           <td><a href="/ecadmin/product/edit.do?productId=${map.key}" target="_top">${map.key}</a><br>${map.value.dataOldMap['productName']}</td>
           <td><span class="txt-red">${map.value.dataNewMap['addOnProductId']}<br>${map.value.dataNewMap['subProductName']}</span></td>
            <td><span class="txt-red">${map.value.dataNewMap['addOnDesc']}</span></td>
           <td><span class="txt-red">${map.value.dataNewMap['startDate']}</span></td>
           <td><span class="txt-red">${map.value.dataNewMap['endDate']}</span></td>
           <td><span class="txt-red">${map.value.dataNewMap['addOnPrice']}</span></td>
            <td><span class="txt-red">
           <s:if test='%{#map.value.dataNewMap["isEnable"] == "Y"}'>是</s:if>
           <s:else>否</s:else>
           </span></td>
           <td>${map.value.failTitle}<!-- ${map.value.failMessage} --></td>
          </tr></s:iterator>
        </tbody>
      </table><br />
        <input type="button" value="回批次排程表" name="submit1" class="nstep" onclick="this.form.action='/ecadmin/batch/common/list.do';this.form.submit();">
      <c:if test="${actorId eq event.createUser && (event.status.code eq 'INIT' || event.status.code eq 'FINISH')}">
		<c:if test="${event.editable}">
		<input type="button" value="修改此批次" name="submit1" class="nstep" onclick="document.location='/ecadmin/batch/${event.batchName}/edit.do?paramBatchEventId=${event.oid}';"></c:if>
		<c:if test="${event.cancelable}">
		<input type="button" value="取消此批次" name="submit1" class="nstep" onclick="document.location='/ecadmin/batch/common/cancel.do?batchEventId=${event.oid}';"></c:if>
		</c:if>
	</s:form><br />
</body>
</html>